// src/api/system.js
import request from '@/utils/request'

export function getSystemInfo() {
    return request({
        url: '/admin/api/system/info',
        method: 'get'
    })
}

export function updateSystemInfo(data) {
    return request({
        url: '/admin/api/system/info',
        method: 'put',
        data
    })
}

export function getApiKeys(params) {
    return request({
        url: '/admin/api/system/api-keys',
        method: 'get',
        params
    })
}

export function addApiKey(data) {
    return request({
        url: '/admin/api/system/api-keys',
        method: 'post',
        data
    })
}

export function updateApiKey(id, data) {
    return request({
        url: `/admin/api/system/api-keys/${id}`,
        method: 'put',
        data
    })
}

export function deleteApiKey(id) {
    return request({
        url: `/admin/api/system/api-keys/${id}`,
        method: 'delete'
    })
}

export function batchDeleteApiKeys(ids) {
    return request({
        url: '/admin/api/system/api-keys/batch-delete',
        method: 'post',
        data: ids
    })
}

export function getApiKeyQuota(id) {
    return request({
        url: `/admin/api/system/api-keys/${id}/quota`,
        method: 'get'
    })
}
